<template>
<div class="phoneSet">
  <h2>客服电话</h2>
  <ul>
    <li><i>*</i><b>电话号码</b></li>
    <li><el-input v-model="phone"></el-input></li>
  </ul>
  <el-button type="primary" @click="save">保存</el-button>
</div>
</template>

<script>
    export default {
      data() {
        return {
          phone:''
        }
      },
      methods:{
        save(){
          if(this.phone == ''){
            this.$message.warning('请输入手机号')
          }else if(!/^1([38]\d|5[0-35-9]|7[3678])\d{8}$/.test(this.phone)){
            this.$message.warning('请输入正确手机号')
          }else {

          }
        }
      }

    }
</script>

<style scoped lang="scss">
.phoneSet{
  width: 100%;
  h2{
    font-size: 25px;
    text-align: left;
    padding-left: 10px;
  }
  ul{
    li{
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      text-align: left;
      padding-left: 10px;
      font-size: 20px;
      height: 30px;
      margin: 20px 0;
      i{
        line-height: 30px;
        vertical-align: middle;
        font-size: 20px;
        color: orangered;
        margin-right: 10px;
      }
      b{
        font-weight: normal;
      }
      .el-input{
        width: 400px;
      }
    }

  }
  .el-button{
   display: flex;
    flex-direction: row;
    justify-content: flex-start;
    margin-left: 150px;
    padding: 10px 40px;
    letter-spacing: 2px;
    font-size: 18px;
    margin-top: 50px;
  }
}
</style>
